package game;

import java.lang.Object;
import java.util.ArrayList;
import game.playerStats;

public class Possesions {

	
	private ArrayList<item> items;

	public Possesions() {
		items = new ArrayList<item>();
		
	}
	
	
	public void addPossesion(item product) {
		
		if(Player.playerStats.getMoney().getValue() >= product.itemCost()) {
			
			items.add(product);
		 	Player.playerStats.getMoney().subtractValue(product.itemCost());
		 	System.out.println("Item added to possesion");
		}
		
		else System.out.println("Insufficient funds");
	}
		
	public boolean removePossesion(item product) {
		
		System.out.println("Item removed from possesion");
		Player.playerStats.getMoney().addValue(product.itemCost());
		return items.remove(product);
		
	}
	
}
